<template>
  <div class="table">
    <template>
      <el-table :data="tableInfo" border style="width: 100%">
        <el-table-column
          prop='username'
          label="登入账户"
          width="180"
          align="center"
        >
        </el-table-column>
        <el-table-column label="上次登入ip" prop="lastLogin.ip" align="center" >
        </el-table-column>
        <el-table-column prop="lastLogin.loginTime" label="上次登入时间" align="center" sortable>
        </el-table-column>
        <el-table-column prop="nowLogin.ip" label="本次登入ip" align="center">
        </el-table-column>
        <el-table-column prop="nowLogin.loginTime" label="本次登入时间" align="center" sortable>
        </el-table-column>
      </el-table>
    </template>
  </div>
</template>
<script>
import { loginLog } from "../../../api";
export default {
  mounted() {
    //钩子函数
    loginLog() //调用
      .then((res) => {
        // console.log(res.data.data);
        this.tableInfo = res.data.data;
      });
  },
  data() {
    return {
      tableInfo: [],
      tableData: [
        {
          date: "2016-05-02",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1518 弄",
        },
        /*    {
          date: "2016-05-04",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1517 弄",
        },
        {
          date: "2016-05-01",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1519 弄",
        },
        {
          date: "2016-05-03",
          name: "王小虎",
          address: "上海市普陀区金沙江路 1516 弄",
        }, */
      ],
    };
  },
};
</script>
<style scoped>
.table {
  margin-top: 20px;
}
</style>

